package main

import "fmt"

type People interface {
	Speak(string) string
}
type Student struct {
	id   int64
	name string
	age  int
	Teacher
}
type Teacher struct {
	id   int64
	name string
	age  int
}

func (s Student) Speak(name string) string {
	return "student:\t" + name + "\t is speaking"
}
func (t Teacher) Speak(name string) string {
	return "teacher:\t" + name + "\tis speaking"
}
func main() {
	var p People

	t := Teacher{
		id:   20010,
		name: "jlily",
		age:  28,
	}
	s := Student{
		id:      10010,
		name:    "lily",
		age:     18,
		Teacher: t,
	}
	p = s
	p = t

	fmt.Println(p.Speak(s.name))

	fmt.Println(p.Speak(t.name))
	fmt.Println(s.Teacher.name)

}
